Fixed broken Web UI after registering the product from CLI#2281
Merged
Fixed broken Web UI after registering the product from CLI#2281
Conversation
imobachgs
approved these changes
Apr 22, 2025
Merged
imobachgs
added a commit
that referenced
this pull request
Apr 22, 2025
Prepare to release Agama 14: * #1994 * #2041 * #2103 * #2178 * #2189 * #2200 * #2205 * #2209 * #2212 * #2213 * #2214 * #2215 * #2216 * #2217 * #2219 * #2220 * #2224 * #2225 * #2226 * #2227 * #2228 * #2230 * #2231 * #2232 * #2233 * #2235 * #2237 * #2239 * #2241 * #2242 * #2244 * #2245 * #2246 * #2247 * #2248 * #2249 * #2250 * #2251 * #2252 * #2253 * #2254 * #2255 * #2256 * #2257 * #2259 * #2260 * #2262 * #2265 * #2266 * #2268 * #2269 * #2271 * #2272 * #2273 * #2275 * #2276 * #2278 * #2281
Merged
lslezak
added a commit
that referenced
this pull request
May 13, 2025
## Problem - When registering the product from CLI the web UI was broken in Firefox  - See #2274 - It was fixed by a workaround: #2281 - But we should find the real fix and remove that ugly workaround ## Debugging To debug the issue I have reverted the #2281 fix and added a small snippet which tracks using the History API into the `web/src/index.tsx` file: ```js let counter = 1; const original = window.history.pushState; window.history.pushState = function (data, unused, url) { console.log("pushState: ", counter, data, url); counter += 1; original.apply(this, [data, unused, url]); }; ``` That revealed that the History API was switching quickly between the product selection page and the probing progress page:  The Firefox browser has a limit of 200 History API calls within 10 seconds. After that an error is reported and an exception is raised. That exception causes a crash in the React router resulting in empty screen. The problematic code was in the main application router: ```tsx if (selectedProduct === undefined && location.pathname !== PRODUCT.root) { return <Navigate to={PRODUCT.root} />; } if (phase === InstallationPhase.Config && isBusy && location.pathname !== PRODUCT.progress) { return <Navigate to={PRODUCT.progress} />; } ``` The problem happened when the selected product was not updated yet (`selectedProduct === undefined`) but probing was already in progress (`isBusy === true`). In that case these conditions caused switching between the two paths as fast as possible. On my machine it was switching about 1000 times per second as displayed in the log above. A similar problem was present in the product selection page. ## Solution - Handle this case explicitly, if that happens display the loading page until the selected product is updated. ## Testing - Tested manually, registration from CLI works fine even without that delay workaround - There are just few calls to the History API 
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
agama-auto-registration-broken.webm
Firefox console log
Solution
Testing
agama-auto-registration-fixed.webm